package com.ghy.dto;

import com.ghy.constant.RE;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author GaoHeYang
 */
@Schema(name="通知添加DTO")
@Data
public class NoticeInsertDTO implements Serializable, RE {


    @NotNull(message="通知序号不能为空")
    @Range(min = 0,message="序号最小为θ")
    @Schema(description = "序号")
    private Long idx;

    @NotEmpty(message="通知内容不能为空")
    @Pattern(regexp = CONTENT_RE, message = CONTENT_RE_MSG)
    @Schema(description="评论内容")
    private String content;
}
